import Vue from 'vue'
import getDeviceInfo from '../common/deviceInfo'
Vue.directive('inputBlur', {
  inserted: function(el, bind) {
    if (getDeviceInfo().isIOS) {
      el.addEventListener('blur', e => {
        setTimeout(() => {
          window.scrollTo(0, document.body.scrollTop + 1)
          document.body.scrollTop >= 1 && window.scrollTo(0, document.body.scrollTop - 1)
        }, 10)
      })
    }
  }
})
